<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <form action="">
        <input type="submit">
    </form>
    <a href="https://www.baidu.com/?tn=25017023_14_dg&ch=1">1</a>
    <script>
        const table = document.querySelector('form');
        console.log(table);
        table.addEventListener('submit', function (e) {
            //阻止默认行为
            e.preventDefault();
        })
        const a = document.querySelector('a');
        console.log(a);
        a.addEventListener('click', function (e) {
            console.log('aaa');

            e.preventDefault();
        })

    </script>
</body>

</html>